﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using ChouteZemUp.GameEntities;
using Microsoft.Xna.Framework;

namespace ChouteZemUp.Engine
{
    class PlayerController : IInput
    {
        public void Update(ControllerGameObject pTarget)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Space))
            {
                
                 ((Player)pTarget).Shoot();
                 
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                
                 if(pTarget.Position.X < 1020)
                  {
                       pTarget.Position += new Vector2(5, 0);
                  }
                
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {
                
                 if(pTarget.Position.X > 10)
                  {
                       pTarget.Position -= new Vector2(5, 0);
                  } 
                
            }
        }
    }
}
